package com.ttbj.rule.service.context;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.ttbj.product.bean.dto.CargoDto;
import com.ttbj.rule.po.CarriageRule;
import com.ttbj.rule.service.BillStrategy;

 
 
public class BillContext {
	public static Logger logger = LoggerFactory.getLogger(BillContext.class);
	// 持有一个具体策略的对象
	private BillStrategy strategy;

	public BillContext(BillStrategy strategy) {
		this.strategy = strategy;
	}

	/**
	 * 策略方法
	 * @param cargo 
	 * @throws Exception 
	 */
	public Float contextInterface(Float dis, CargoDto cargo, CarriageRule bill) throws Exception {
		logger.info("里程:{}",dis);
		logger.info("计费规则:{}",bill);
		return strategy.strategyInterface(dis,cargo,bill);
	}

}
